﻿@model IEnumerable<Cafeteria.Models.Compra.Ordencompra.OrdencompraBean>

@{
    ViewBag.Title = "Buscar";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
   

    <div class="wrapper">
    <div class="widget">
      <div class="title">
      <h6>Lista de Orden de compra</h6>
      </div>
      <div class="dataTables_wrapper">
            
            <table cellpadding = "0" cellspacing = "0" width = "100%" class = "display dTable">
    <thead>
        <tr>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:150px;" >
                <div class="DataTables_sort_wrapper">
                Fecha
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
             <th class="ui-state-default" rowspan="1" colspan="1" style="width:100px;" >
                <div class="DataTables_sort_wrapper">
                Sucursal
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:100px;" >
                <div class="DataTables_sort_wrapper">
                Total
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
             <th class="ui-state-default" rowspan="1" colspan="1" style="width:100px;" >
                <div class="DataTables_sort_wrapper">
                Estado
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:210px;" >

            </th>
        </tr>
    </thead>

    <tbody>
    @foreach (var item in Model)
    {
        
        <tr class="gradeA odd">
            <td>@Html.DisplayFor(modelItem => item.fecha)</td>
            <td>@Html.DisplayFor(modelItem => item.nombreSucursal)</td>
            <td>@Html.DisplayFor(modelItem => item.precioTotal)</td>
            <td>@Html.DisplayFor(modelItem => item.estado)</td>
            <td>
                <a href="@Url.Action("DetalleOrdenC", new { id = item.idOrdenCompra })"><img src="../../Content/images/icons/color/edit-column.png", alt="Edit" />Detalle </a> | 
                @if(item.estado.CompareTo("Atendido")!=0)
                {
                     <a href="@Url.Action("ModificarOrdenC", new { id = item.idOrdenCompra })"><img src="../../Content/images/icons/color/pencil.png", alt="Delete" />Modificar</a>
                }

            </td>
        </tr>
    
        
    }
    </tbody>
    </table>
    </div>        
    </div>
</div>
    <p></p><p></p><p></p>
    <div>           
        @Html.ActionLink("Regresar", "Buscar")
    </div>